package com.example.validation.entity;

import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
public class User {
    private int id;

    @NotNull(message = "姓名不能为空")
    private String username;

    @Pattern(regexp = "^1[3,4,5,6,7,8,9]\\\\d{9}$",
            message = "手机号格式不对")
    private String phone;

    @Email(message = "邮箱格式不对")
    private String email;

}
